<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .content {
            padding: 10px;
            display: grid;/** 根据 grid-template-columns值 分成格子 */
            grid-template-columns: auto auto auto;  /*    竖向排列  表示 有3列，每列宽度auto*/
            grid-template-rows: auto auto auto;  /*横向排列 表示 有3行，每行宽度auto*/
            height: 800px; /*padding 有个20的宽度*/
            /* background-color: #000; */
            grid-gap: 10px; /*上下左右间隔10px*/
            border: 1px solid red;
            box-sizing: border-box;



        }

        .b {
            background-color: yellow;
        }
    </style>
</head>

<body>
    <div class="content">
        <div class="b">1</div>
        <div class="b">2</div>
        <div class="b">3</div>
        <div class="b">4</div>
        <div class="b">5</div>
        <div class="b">6</div>
        <div class="b">7</div>
        <div class="b">8</div>
        <div class="b">9</div>
    </div>
</body>

</html>